﻿*GET DATA.
GET 
  FILE='/CASEY/UM_drive/data/2016 CCES/initial data delivery/CCES16_MIA_OUTPUT_Feb2017.sav'. 
DATASET NAME DataSet1 WINDOW=FRONT

*CODE DVs.
   *same sex marriage.
if pitchintro  = 1 SSM = MIA409.
if pitchintro  = 2 SSM = MIA415.
if pitchintro  = 3 SSM = MIA421.
if pitchintro  = 4 SSM = MIA427.
variable labels SSM "pro same sex marriage".
FREQUENCIES VARIABLES=SSM.

   *gun control.
if pitchintro  = 1 GC = MIA410.
if pitchintro  = 2 GC = MIA416.
if pitchintro  = 3 GC = MIA422.
if pitchintro  = 4 GC = MIA428.
variable labels GC "pro gun control".
FREQUENCIES VARIABLES=GC.

   *higher taxes on the rich.
if pitchintro  = 1 HT = MIA411.
if pitchintro  = 2 HT = MIA417.
if pitchintro  = 3 HT = MIA423.
if pitchintro  = 4 HT = MIA429.
variable labels HT "pro higher taxes".
FREQUENCIES VARIABLES=HT.

   *deport undocumented.
if pitchintro  = 1 DU = MIA412.
if pitchintro  = 2 DU = MIA418.
if pitchintro  = 3 DU = MIA424.
if pitchintro  = 4 DU = MIA430.
variable labels DU "pro deportation".
FREQUENCIES VARIABLES=DU.

   *support military.
if pitchintro  = 1 SM = MIA413.
if pitchintro  = 2 SM = MIA419.
if pitchintro  = 3 SM = MIA425.
if pitchintro  = 4 SM = MIA431.
variable labels SM "pro military".
FREQUENCIES VARIABLES=SM.

 *less government spending.
if pitchintro  = 1 LGS = MIA414.
if pitchintro  = 2 LGS = MIA420.
if pitchintro  = 3 LGS = MIA426.
if pitchintro  = 4 LGS = MIA432.
variable labels LGS "pro less gov't spending".
FREQUENCIES VARIABLES=LGS.

*SEX RATIO IN POST ELECTION QUEST.
CROSSTABS 
  /TABLES=gender BY pitchintro 
  /FORMAT=AVALUE TABLES 
  /CELLS=COUNT 
  /COUNT ROUND CELL.

*COUNT ON HEADPHONES VS SPEAKERS.
CROSSTABS 
  /TABLES=gender BY MIA407 
  /FORMAT=AVALUE TABLES 
  /CELLS=COUNT 
  /COUNT ROUND CELL.

*BASIC UNIVARIATE ANALYSIS.
   *same sex marriage.
UNIANOVA SSM BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

   *gun control.
UNIANOVA GC BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

   *higher taxes.
UNIANOVA HT BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

   *deport undocumented.
UNIANOVA DU BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

   *support military.
UNIANOVA SM BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

   *less gov't spending.
UNIANOVA LGS BY pitchintro 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro.

*NOW ADD PID AND DO FULL FACTORIAL MODEL.
   *take care of NAs in pid3.
recode pid3 (1=1) into pid3_recode.
recode pid3 (2=2) into pid3_recode.
recode pid3 (3=3) into pid3_recode.
recode pid3 (4=.) into pid3_recode.
recode pid3 (5=.) into pid3_recode.
value labels pid3_recode 1 "DEM" 2 "REP" 3 "INDY".
frequencies pid3 pid3_recode.
   *get counts for post election survey.
CROSSTABS 
  /TABLES=pid3_recode BY MIA407 
  /FORMAT=AVALUE TABLES 
  /CELLS=COUNT 
  /COUNT ROUND CELL.

   *same sex marriage.
UNIANOVA SSM BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.

   *gun control.
UNIANOVA GC BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.

   *higher taxes.
UNIANOVA HT BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.

   *deport undocumented.
UNIANOVA DU BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.

   *support military.
UNIANOVA SM BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.

   *less government spending.
UNIANOVA LGS BY pitchintro pid3_recode 
  /METHOD=SSTYPE(3) 
  /INTERCEPT=INCLUDE 
  /EMMEANS=TABLES(pitchintro) 
  /EMMEANS=TABLES(pid3_recode) 
  /EMMEANS=TABLES(pitchintro*pid3_recode) 
  /CRITERIA=ALPHA(.05) 
  /DESIGN=pitchintro pid3_recode pitchintro*pid3_recode.






